package top.lingkang.securityoauth2.server.config;

import org.springframework.beans.factory.annotation.Autowired;
import top.lingkang.securityoauth2.core.entity.ClientDetail;
import top.lingkang.securityoauth2.core.entity.UserDetail;
import top.lingkang.securityoauth2.core.utils.SpringRequestUtils;
import top.lingkang.securityoauth2.server.auth.TokenGenerate;
import top.lingkang.securityoauth2.server.store.TokenStore;

import javax.servlet.http.HttpServletRequest;

/**
 * @author lingkang
 * Created by 2022/7/5
 */
public class SecurityOauth2Server {

    @Autowired
    private TokenStore tokenStore;
    @Autowired
    private TokenGenerate tokenGenerate;

    public Object login(UserDetail userDetail, ClientDetail clientDetail) {
        HttpServletRequest request = SpringRequestUtils.getRequest();
        String token = tokenGenerate.token(request);
        String refreshToken = tokenGenerate.refreshToken(request);

        return null;
    }
}
